-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Add padding to diff code blocks #10996
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will take a look at the preview once it is ready. Since I am not super experienced with CSS, it would be good if someone with more experience could take a look at the code changes
@@ -73,12 +76,16 @@ | |||
:global(.diff-inserted), | |||
:global(.inserted) { | |||
background-color: rgba(16, 185, 129, 0.2); | |||
margin-left: -12px; | |||
width: calc(100% + 12px); | |||
} | |||
|
|||
/* Set deleted line (-) color */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe update this comment (and the comment for the above changes) to reflect that we are also setting the padding here
Bundle ReportChanges will increase total bundle size by 158 bytes ⬆️
|
We might also want to inform folks somewhere about how they should write diff blocks going forward. Previously, unchanged and changed lines were only aligned when the unchanged lines were indented two spaces, like so:
Following your changes, does alignment work in the same way? |
Alignment works the same way, but the padding is now added automatically. So if a diff block currently contains manual indentations, the padding will be added on top. There are ~100 diff blocks in the project, I can check if they need to be updated. |
The selector is a bit too generic and adds padding after other operators in the code examples. I'm trying to fix that in: |
fixes #10510